#include <iostream>
using namespace std;

int gcd(int m, int n)
{
	if(m%n!=0)
	{
		gcd(n,m%n);
	}
	else
	{
		return n;
	}
}

int main()
{
	int m,n;
	cin >> m >> n;
	if((m/gcd(m,n))%2==0)
	{
		cout << "B"<<endl;
	}
	else
	{
		cout << "A" << endl;
	}
	
	return 0;
} 


